---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.12.log
  log type:  text
 opened on:  12 May 2025, 17:04:40

. 
. use "C:\Users\sbstjp\OneDrive - Cardiff University\UKPVS.dta" // Prosser, Magasin, Proulx and Haddock, UK Pro
> gressive Values Dataset, September 2024 // Accessed on March 20 2025

. 
. // Demographics
. 
. *Delete missing values and rename
. replace gender=. if inrange(gender, 3, 5)
(11 real changes made, 11 to missing)

. rename gender FemaleGender

. replace Household_Income=. if Household_Income==999
(15 real changes made, 15 to missing)

. 
. *Create dummies
. gen Childless=.
(617 missing values generated)

. replace Childless=1 if ChildrenNo==0
(368 real changes made)

. replace Childless=0 if inrange(ChildrenNo, 1, 10)
(249 real changes made)

. gen FemGenChildlessInteraction = FemaleGender * Childless 
(11 missing values generated)

. gen AgeFemGenInteraction = FemaleGender * ageNew 
(12 missing values generated)

. 
. gen Graduate=. 
(617 missing values generated)

. replace Graduate=0 if inrange(Education, 1, 15)
(212 real changes made)

. replace Graduate=1 if inrange(Education, 16, 18)
(405 real changes made)

. 
. gen MinorityEthnic=. 
(617 missing values generated)

. replace MinorityEthnic=0 if Ethnicity2==1
(200 real changes made)

. replace MinorityEthnic=1 if inrange(Ethnicity2, 2, 5)
(417 real changes made)

. 
. gen SocCulEmployment=. 
(617 missing values generated)

. replace OccupationSector=. if OccupationSector==24
(57 real changes made, 57 to missing)

. replace SocCulEmployment=0 if inrange(OccupationSector, 11, 22)
(200 real changes made)

. replace SocCulEmployment=1 if inrange(OccupationSector, 5, 10)
(170 real changes made)

. replace SocCulEmployment=0 if inrange(OccupationSector, 1, 4)
(146 real changes made)

. 
. // Create a weight
. gen weight = 1

. 
. * Code age into categories - the other variables are already in such categories
. recode ageNew (min/24=1 "0-24") (25/34=2 "25-34") (35/44=3 "35-44") (45/54=4 "45-54") (55/max=5 "55+"), gener
> ate(age_group)
(616 differences between ageNew and age_group)

. 
. * Generate totals for the weights - these are based on BESW29 as this dataset has political selfid, unlike ce
> nsus data
. gen sextot=.
(617 missing values generated)

. replace sextot = 0.50 if FemaleGender == 1 // Male
(241 real changes made)

. replace sextot = 0.50 if FemaleGender == 2 // Female
(365 real changes made)

. 
. gen agetot=.
(617 missing values generated)

. replace agetot = 0.13 if age_group == 1 //18-24
(134 real changes made)

. replace agetot = 0.14 if age_group == 2 //25-34
(193 real changes made)

. replace agetot = 0.19 if age_group == 3 //35-44
(139 real changes made)

. replace agetot = 0.19 if age_group == 4 //45-54
(92 real changes made)

. replace agetot = 0.35 if age_group == 5 //55+
(58 real changes made)

. 
. gen ethtot=.
(617 missing values generated)

. replace ethtot = 0.86 if Ethnicity2 == 1 // White
(200 real changes made)

. replace ethtot = 0.06 if Ethnicity2 == 2 // Asian
(148 real changes made)

. replace ethtot = 0.04 if Ethnicity2 == 3 // Black
(131 real changes made)

. replace ethtot = 0.04 if Ethnicity2 == 4 // Mixed
(117 real changes made)

. 
. gen edcats=.
(617 missing values generated)

. replace edcats=1 if inrange(Education, 1, 15) // Unidiplomaandbelow
(212 real changes made)

. replace edcats=2 if Education==16 // Undergraddegree
(241 real changes made)

. replace edcats=3 if inrange(Education, 17, 18) // Postgradandabove
(164 real changes made)

. 
. gen edtot=.
(617 missing values generated)

. replace edtot = 0.4740 if edcats == 1 // Unidiplomaandbelow
(212 real changes made)

. replace edtot = 0.2969 if edcats == 2 // Undergraddegree
(241 real changes made)

. replace edtot = 0.2291 if edcats == 3 // Postgradandabove
(164 real changes made)

. 
. gen inccats=.
(617 missing values generated)

. replace inccats=1 if inrange(Household_Income, 1, 6) //under 30k
(155 real changes made)

. replace inccats=2 if inrange(Household_Income, 7, 11) //30-60k
(168 real changes made)

. replace inccats=3 if inlist(Household_Income, 12, 13) //60-100k
(173 real changes made)

. replace inccats=4 if inlist(Household_Income, 14, 15) //over 100k
(106 real changes made)

. 
. gen inctot=.
(617 missing values generated)

. replace inctot = 0.3806 if inccats == 1 //under 30k
(155 real changes made)

. replace inctot = 0.3524 if inccats == 2 //30-60k
(168 real changes made)

. replace inctot = 0.1922 if inccats == 3 //60-100k
(173 real changes made)

. replace inctot = 0.0747 if inccats == 4 //over 100k
(106 real changes made)

. 
. * Rake the weights using the Stata survwgt package
. survwgt rake weight , by(FemaleGender age_group Ethnicity2 edcats inccats) totvars(sextot agetot ethtot edtot
>  inctot) generate(rakedweight)

. 
. // Standardize variables
. egen Age = std(ageNew)
(1 missing value generated)

. egen Income = std(Household_Income)
(15 missing values generated)

. 
. rename PVS pvs

. * Change to 1-2 scale, so it's the same as other dependent variables in the book
. foreach var in pvs {
  2.     gen s`var' = 1 + (`var' - 1) / (7 - 1)
  3. }

. 
. rename spvs PVS

. 
. // Correlations
. regress PVS Age FemaleGender Graduate Income MinorityEthnic SocCulEmployment [pweight= rakedweight], robust
(sum of wgt is .8403447326282283)

Linear regression                               Number of obs     =        483
                                                F(6, 476)         =       4.43
                                                Prob > F          =     0.0002
                                                R-squared         =     0.0603
                                                Root MSE          =     .09174

----------------------------------------------------------------------------------
                 |               Robust
             PVS | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------+----------------------------------------------------------------
             Age |  -.0148214   .0058549    -2.53   0.012     -.026326   -.0033167
    FemaleGender |   .0009588   .0153737     0.06   0.950      -.02925    .0311676
        Graduate |    .002766   .0155697     0.18   0.859    -.0278278    .0333599
          Income |   .0039238    .007441     0.53   0.598    -.0106975     .018545
  MinorityEthnic |   .0308413   .0110325     2.80   0.005     .0091628    .0525197
SocCulEmployment |   .0128263   .0198777     0.65   0.519    -.0262326    .0518851
           _cons |    1.50119   .0241452    62.17   0.000     1.453746    1.548634
----------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress PVS Age FemaleGender Graduate Income MinorityEthnic AgeFemGenInteraction [pweight= rakedweight], robu
> st
(sum of wgt is .9999000132083892)

Linear regression                               Number of obs     =        570
                                                F(6, 563)         =       5.30
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0597
                                                Root MSE          =     .09188

--------------------------------------------------------------------------------------
                     |               Robust
                 PVS | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------------+----------------------------------------------------------------
                 Age |  -.0108669   .0170613    -0.64   0.524    -.0443784    .0226446
        FemaleGender |   .0165414   .0369931     0.45   0.655      -.05612    .0892028
            Graduate |   .0131096   .0148368     0.88   0.377    -.0160327    .0422519
              Income |   .0000495   .0067651     0.01   0.994    -.0132384    .0133375
      MinorityEthnic |    .026648   .0099588     2.68   0.008     .0070872    .0462089
AgeFemGenInteraction |  -.0001925   .0008586    -0.22   0.823     -.001879    .0014939
               _cons |   1.490497   .0229869    64.84   0.000     1.445347    1.535648
--------------------------------------------------------------------------------------

. eststo
(est2 stored)

. regress PVS Age FemaleGender Graduate Income MinorityEthnic Childless [pweight= rakedweight], robust
(sum of wgt is .9999000132083892)

Linear regression                               Number of obs     =        570
                                                F(6, 563)         =       5.80
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0627
                                                Root MSE          =     .09174

--------------------------------------------------------------------------------
               |               Robust
           PVS | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
           Age |  -.0164766   .0071318    -2.31   0.021    -.0304847   -.0024685
  FemaleGender |   .0063145   .0138212     0.46   0.648    -.0208329     .033462
      Graduate |   .0143728   .0143544     1.00   0.317    -.0138219    .0425674
        Income |   -.001289   .0066172    -0.19   0.846    -.0142864    .0117083
MinorityEthnic |   .0267134   .0099982     2.67   0.008     .0070751    .0463518
     Childless |  -.0116982   .0169215    -0.69   0.490    -.0449351    .0215388
         _cons |   1.501867    .026866    55.90   0.000     1.449097    1.554637
--------------------------------------------------------------------------------

. eststo
(est3 stored)

. regress PVS Age FemaleGender Graduate Income MinorityEthnic Childless FemGenChildlessInteraction [pweight= ra
> kedweight], robust
(sum of wgt is .9999000132083892)

Linear regression                               Number of obs     =        570
                                                F(7, 562)         =       5.48
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0682
                                                Root MSE          =     .09155

--------------------------------------------------------------------------------------------
                           |               Robust
                       PVS | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------------------+----------------------------------------------------------------
                       Age |  -.0163996   .0071721    -2.29   0.023    -.0304871   -.0023122
              FemaleGender |  -.0083946   .0146408    -0.57   0.567    -.0371519    .0203627
                  Graduate |   .0148378   .0143011     1.04   0.300    -.0132524     .042928
                    Income |  -.0027518   .0066171    -0.42   0.678     -.015749    .0102455
            MinorityEthnic |   .0251304   .0099802     2.52   0.012     .0055274    .0447334
                 Childless |  -.0553181    .044547    -1.24   0.215    -.1428171    .0321809
FemGenChildlessInteraction |   .0288207    .026879     1.07   0.284    -.0239749    .0816162
                     _cons |   1.524337   .0293059    52.01   0.000     1.466775      1.5819
--------------------------------------------------------------------------------------------

. eststo
(est4 stored)

. esttab

----------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)   
                      PVS             PVS             PVS             PVS   
----------------------------------------------------------------------------
Age               -0.0148*        -0.0109         -0.0165*        -0.0164*  
                  (-2.53)         (-0.64)         (-2.31)         (-2.29)   

FemaleGender     0.000959          0.0165         0.00631        -0.00839   
                   (0.06)          (0.45)          (0.46)         (-0.57)   

Graduate          0.00277          0.0131          0.0144          0.0148   
                   (0.18)          (0.88)          (1.00)          (1.04)   

Income            0.00392       0.0000495        -0.00129        -0.00275   
                   (0.53)          (0.01)         (-0.19)         (-0.42)   

MinorityEt~c       0.0308**        0.0266**        0.0267**        0.0251*  
                   (2.80)          (2.68)          (2.67)          (2.52)   

SocCulEmpl~t       0.0128                                                   
                   (0.65)                                                   

AgeFemGenI~n                    -0.000193                                   
                                  (-0.22)                                   

Childless                                         -0.0117         -0.0553   
                                                  (-0.69)         (-1.24)   

FemGenChil~n                                                       0.0288   
                                                                   (1.07)   

_cons               1.501***        1.490***        1.502***        1.524***
                  (62.17)         (64.84)         (55.90)         (52.01)   
----------------------------------------------------------------------------
N                     483             570             570             570   
----------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.12.log
  log type:  text
 closed on:  12 May 2025, 17:04:55
---------------------------------------------------------------------------------------------------------------
